<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'
import { useDesign } from '@/hooks/web/useDesign'
import titleIcon from '@/assets/images/titleIcon.png';

defineOptions({ name: 'ContentWrap' })

const { getPrefixCls } = useDesign()

const prefixCls = getPrefixCls('content-wrap')

defineProps({
  title: propTypes.string.def(''),
  message: propTypes.string.def(''),
  pcontent: propTypes.string.def(''),
  styleParams: propTypes.object.def({
    backgroundColor: '#fff!important',
    padding:'20px',
    borderRadius:'8px!important',
  })
})
</script>

<template>
  <ElCard :class="['cardColor','mb-10px']" :style="styleParams" shadow="never" :body-style="{padding:'0px'}">
    <template v-if="title" #header>
      <div class="card-title">
            <div class="title-div">
              <img :src="titleIcon" alt="">
            </div>
            <div class="title">
              <div>{{ title }}</div>
              <span class="pspan" >{{ pcontent }}</span>
            </div>
          </div>
    </template>
    <div>
      <slot></slot>
    </div>
  </ElCard>
</template>

<style scoped lang="scss">
::deep(.cardColor){
  background-color: #fff!important;
  box-sizing: border-box!important;
  border-radius: 8px;
  border-width: 1px;
  border-style: solid;
  border-image: linear-gradient(to bottom , #ACCDFB 0%, #ACCDFB 46%, #FFFFFF 100%) 1!important;
  background-clip: padding-box;
  clip-path: inset(0 round 8px)!important;
}
:deep(.el-card__header){
  font-size: 16px;
  padding: 0px 0px 10px 0 !important;
    
}
.card-title{
  width: 100%;
  height: 27px;
  display: flex !important;
  align-items: center !important;
  .title-div {
      width: 16px;
      height: 16px;
      margin-right: 5px;
  }
  .title{
    white-space: nowrap;
    display: flex !important;
    align-items: center !important;
    font-size: 16px;
    font-weight: 400;
    color: #333333;
    .pspan{
      margin-left: 10px;
      font-size: 14px;
      color: #999999
    }
  }
}
</style>
